package com.meida.module.bus.provider.controller;

import com.meida.common.mybatis.model.ResultBody;
import com.meida.common.springmvc.base.BaseController;
import com.meida.module.bus.client.entity.VipType;
import com.meida.module.bus.provider.service.BusVipTypeService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * @author lidd
 * @description: vip业务
 * @date: 2022年-06月-25日  12:06:53
 */
@RestController
@RequestMapping("/bus/vip/")
public class BusVipController extends BaseController<BusVipTypeService, VipType> {

    @Resource
    BusVipTypeService busVipTypeService;


    @ApiOperation(value = "后台调整用户会员身份", notes = "后台调整用户会员身份")
    @PostMapping(value = "buyVip")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "vipTypeId", required = true, value = "会员类型ID"),
            @ApiImplicitParam(name = "userId", required = true, value = "用户ID")
    })
    public ResultBody buyVip(@RequestParam(value = "vipTypeId") Long vipTypeId, @RequestParam(value = "userId") Long userId) {
        return ResultBody.ok(busVipTypeService.buyVip(vipTypeId, userId));
    }


}
